package com.poker;


import java.util.List;

/**
 * 比较杂牌的大小
 */
public class ZaPaiComparePokers implements PokerCompare {
    /**
     * 每人5张牌，逐一比较大小
     * 杂牌为由一张大，就大，直到所有一样大，返回0，一样大
     */
    @Override
    public Integer comparePokers(List<Integer> gamblerOne, List<Integer> gamblerTwo) {
        for (int i = 0; i < 5; i++) {
            int result = gamblerOne.get(i).compareTo(gamblerTwo.get(i));
            if (0 != result) {
                return result;
            } else if (0 == result && i != 4) {
                continue;
            } else {
                return 0;
            }
        }
        return 0;
    }
}
